package com.google.android.gms.internal;

import java.io.IOException;

public final class zzfmd extends zzflm<zzfmd> {
    public String mimeType = null;
    public Integer zzbdh = null;
    public byte[] zzpxg = null;

    public zzfmd() {
        this.zzpvl = null;
        this.zzpnr = -1;
    }

    /* access modifiers changed from: private */
    /* renamed from: zzbl */
    public final zzfmd zza(zzflj zzflj) throws IOException {
        while (true) {
            int zzcxx = zzflj.zzcxx();
            if (zzcxx == 0) {
                return this;
            }
            if (zzcxx == 8) {
                try {
                    int zzcya = zzflj.zzcya();
                    switch (zzcya) {
                        case 0:
                        case 1:
                            this.zzbdh = Integer.valueOf(zzcya);
                            break;
                        default:
                            StringBuilder sb = new StringBuilder(36);
                            sb.append(zzcya);
                            sb.append(" is not a valid enum Type");
                            throw new IllegalArgumentException(sb.toString());
                    }
                } catch (IllegalArgumentException unused) {
                    zzflj.zzmw(zzflj.getPosition());
                    zza(zzflj, zzcxx);
                }
            } else if (zzcxx == 18) {
                this.mimeType = zzflj.readString();
            } else if (zzcxx == 26) {
                this.zzpxg = zzflj.readBytes();
            } else if (!super.zza(zzflj, zzcxx)) {
                return this;
            }
        }
    }

    public final void zza(zzflk zzflk) throws IOException {
        if (this.zzbdh != null) {
            zzflk.zzad(1, this.zzbdh.intValue());
        }
        if (this.mimeType != null) {
            zzflk.zzp(2, this.mimeType);
        }
        if (this.zzpxg != null) {
            zzflk.zzc(3, this.zzpxg);
        }
        super.zza(zzflk);
    }

    /* access modifiers changed from: protected */
    public final int zzq() {
        int zzq = super.zzq();
        if (this.zzbdh != null) {
            zzq += zzflk.zzag(1, this.zzbdh.intValue());
        }
        if (this.mimeType != null) {
            zzq += zzflk.zzq(2, this.mimeType);
        }
        return this.zzpxg != null ? zzq + zzflk.zzd(3, this.zzpxg) : zzq;
    }
}
